As Internet Protocol (IP) technologies are applied to telecom networks, telecom equipment is generally required to support IP transmission. However, a lot of telecom equipment requires high precision of clock synchronization; for example, a time division-code division multiple access (TD-CDMA) system requires a NodeB to provide time precision not lower than ±1.5 μs. Conventional IP networks are based on packet switching and require no high precision of synchronization, and are not competent for IP transmission. Moreover, an IP network imposes no special requirement on the physical layer and the data link layer, and an operating network may be composed of different types of physical networks. In such a network environment (which is composed of packet networks and hybrid networks), the ultimate solution to clock synchronization is the IP-layer clock protocol. Therefore, the IEEE1588 protocol (also known as Precision Time Protocol (PTP)) and the IEEE1588v2 protocol (namely, PTPv2) are developed and are applied widely.
The uncertainty of delay of an IP clock packet on a transmission path is primarily caused by processing (such as queuing, and congestion control) of the network nodes on the path. The core conception of clock synchronization based on IEEE1588v2 is to eliminate delay of processing a clock packet on the transmission path and synchronize clocks. That is, the IEEE1588v2 protocol defines an application scenario of a clock packet, and the clock source and the destination clock parse the clock packet. The time of processing the clock packet by a network node is recorded in a processing time correction field, and the processing time of the clock packet is corrected by correcting the correction field of the clock packet, so that clock synchronization is implemented.
However, the IEEE1588v2 protocol does not take the application scenario that a user datagram protocol/internet protocol (UDP/IP) data packet of the clock packet is transmitted through a tunnel into account.
In the process of implementing the present invention, the inventor finds at least the following problems in the prior art: The clock synchronization is not practicable in the prior art unless the time of a tunnel egress node is absolutely synchronized with the time of a tunnel ingress node when the clock packet is transmitted through a tunnel. In practice, it is hardly practicable to implement absolute time synchronization between the tunnel ingress node and the tunnel egress node, which leads to errors in clock synchronization of the clock packet transmitted through a tunnel.